﻿// Extensions Made Easy - Copyright 2012 by Jan Van der Haegen - All rights reserved, use for educational purposes only.

using System;
using System.ComponentModel;

namespace ExtensionsMadeEasy.ClientAPI.Commands
{
    public interface IEasyCommandExporter : INotifyPropertyChanged
    {
        /// <summary>
        /// Gets or sets the description (used as a tooltip)
        /// </summary>
        string Description { get; set; }
        /// <summary>
        /// Gets or sets the display name (used as a label)
        /// </summary>
        string DisplayName { get; set; }
        /// <summary>
        /// Gets or sets the name of the group in which this command should appear
        /// </summary>
        string GroupName { get; set; }
        /// <summary>
        /// Gets or sets the Uri that identifies the image to appear on the command
        /// </summary>
        Uri ImageUri { get; set; }

        /// <summary>
        /// Gets a bool that indicates if a small image should be used for the commands.  (Three "small" commands can be stacked vertically next to one "normal" sized command)
        /// </summary>
        bool UseSmallImage { get; }

        /// <summary>
        /// Returns a string that is used when sorting the commands in a command group.  
        /// Sorting is required to ensure a consistent user experience.  
        /// Commands are sorted by "{PrefixForSorting} + {DisplayName}".
        /// </summary>
        string PrefixUsedForSortingWithinGroup { get; }
         
        /// <summary>
        /// Returns true if this command should only run on the main dispatcher.
        /// </summary>
        bool ForceMainDispatcher { get; }

        /// <summary>
        /// Gets or sets a bool that indicates if the command should be currently enabled (clickable)
        /// </summary>
        bool IsEnabled { get; set; }
        /// <summary>
        /// Gets a bool that indicates if the command should be currently active (visible)
        /// </summary>
        /// <param name="currentScreen"></param>
        /// <returns></returns>
        bool IsCommandActiveForScreen(Microsoft.LightSwitch.Client.IScreenObject currentScreen);

        /// <summary>
        /// Executes the command (place your logic here).
        /// </summary>
        /// <param name="currentScreen"></param>
        void Execute(Microsoft.LightSwitch.Client.IScreenObject currentScreen);
    }
}